/*=======================================================

    HCView V1.0
    文档Tab对象实现单元
    作者：荆通(18114532@qq.com)
    QQ群：649023932

=======================================================*/

import { THCTextRectItem } from "./HCRectItem.js";
import { THCStyle } from "./HCStyle.js";
import { HC } from "./HCCommon.js";

export class THCTabItem extends THCTextRectItem {
    constructor(ownerData) {
        super(ownerData);
        this.StyleNo = THCStyle.Tab;
        let vSize = ownerData.Style.TempCanvas.textMetric("荆通");
        this.Width = vSize.width;
        this.Height = vSize.height;
    }

    GetOffsetAt(x) {
        if (x < this.Width / 2)
            return HC.OffsetBefor;
        else
            return HC.OffsetAfter;
    }

    JustifySplit() {
        return false;
    }
}